package com.joker.aigc.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * Description: 角色枚举
 * Author: <a href="https://github.com/zongzibinbin">abin</a>
 * Date: 2023-03-19
 */
@AllArgsConstructor
@Getter
public enum UserApplyStatusEnum {
    APPLY(1, "申请好友"),
    FRIEND(2, "通过申请好友信息"),
    BLANK(3, "拒绝申请好友"),
    ;

    private final Integer id;
    private final String desc;

    private static final Map<Integer, UserApplyStatusEnum> cache;

    static {
        cache = Arrays.stream(UserApplyStatusEnum.values()).collect(Collectors.toMap(UserApplyStatusEnum::getId, Function.identity()));
    }

    public static UserApplyStatusEnum of(Long type) {
        return cache.get(type);
    }
}
